#include <stdio.h>
#include "hashtable.h"

#ifndef _COMMANDMAP_
#define _COMMANDMAP_

//! A single mapping from string to function
typedef struct LCommand {
	//! Address of the function
	ADDRESS Function;
	//! unique key string
	char *Description;
} Command;

//! A set of mappings
typedef struct LCommandMap {
	//! A simple hash table contains the mappings
	HashTable Map;
} CommandMap;

CommandMap CreateCommandMap(int size);
int CMExecute(CommandMap *map, char *cmd);
int CMSet(CommandMap *map, int (*func)(char**), char *cmd, char *description);
int getline(char *line, int *bytes, FILE *stream);

#endif
